<?php
namespace App\Controller;

class UploadersController extends AppController{

    public function initialize()
    {
        parent::initialize();
    }

    /*
     * create by phpstorm
     * author：DaveTang
     * date：2020.04.14
     * ps：图片上传
     * */
    public function uploader() {
        $this->loadComponent('Upcos');
        $data = $this->request->getData('file');
        $re = $this->Upcos->upload($data);
        if ($re['status'] === 200) {
            $this->G->success('ok',$re['data']);
        } else {
            $this->G->error($re['msg']);
        }
    }
}
?>